-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable execution of well known batch fixer from non-VS host #23492
Conversation
Well known batch fixer expects a MEF exported IDocumentTextDifferencingService, but we only have one in the EditorFeatures layer. We already have a simple default differencing service in the workspace, this change exports it at the default service layer. This change unblocks enabling FixAll testing in roslyn-analyzers repo: dotnet/roslyn-analyzers#1420
💭 Do you know why this was never a problem for StyleCop Analyzers testing? Edit: Requirement is "new": #17497. |
@sharwell StyleCop seems to be using a custom well known batch fixer, not Roslyn's well known batch fixer. |
@mavasani The custom batch fixer is just an old build of the Roslyn batch fixer with the determinism bug fixed. 😄 |
Essentially |
@mavasani you probably want to remove new Default... in http://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces/LinkedFileDiffMerging/LinkedFileDiffMergingSession.cs,89 since we have default service now. |
@heejaechang I tried to remove that in the previous commit, but seems it is needed for test path with custom export provider. See the failure: https://ci.dot.net/job/dotnet_roslyn/job/master/job/windows_debug_unit32_prtest/10901/testReport/junit/Microsoft.VisualStudio.LanguageServices.UnitTests.Preview/PreviewChangesTests/TestLinkedFileChangesMergedAndDeduplicated/. I will revert my last commit c24e51e |
This reverts commit c24e51e.
@Pilchie @jinujoseph for ask mode approval. |
@mavasani I need an ask mode template. |
@Pilchie Sorry, added now. |
Well known batch fixer expects a MEF exported IDocumentTextDifferencingService, but we only have one in the EditorFeatures layer.
We already have a simple default differencing service in the workspace, this change exports it at the default service layer.
This change unblocks enabling FixAll testing in roslyn-analyzers repo: dotnet/roslyn-analyzers#1420
Ask Mode template
Customer scenario
Unable to write FixAll unit tests for fixers using well known batch fixer outside of Roslyn code base.
Bugs this fixes
dotnet/roslyn-analyzers#1420
Workarounds, if any
None, except for not using the well known batch fixer.
Risk
Low as we are just MEF exporting an existing service implementation.
Performance impact
Low
Is this a regression from a previous update?
No
Root cause analysis
We do not have any FixAll unit tests in roslyn-analyzers repo currently. We are planning to add them this sprint.
How was the bug found?
Attempting to implement dotnet/roslyn-analyzers#1420
Test documentation updated?
N/A